﻿using Microsoft.CodeAnalysis;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UMLSynthesizer.LangAnalyzer;
using UMLSynthesizer.LangAnalyzer.Elements;

namespace UMLSynthesizer.CSharpAnalyzer.Elements
{
    abstract class CSharpVariableBase : IVariableElement
    {
        #region Fields

        protected SyntaxNode elementNode;

        #endregion

        #region Constructor

        public CSharpVariableBase(SyntaxNode elementNode, IElementBase parentElement)
        {
            if (elementNode == null)
                throw new ArgumentNullException("elementNode");
            if (parentElement == null)
                throw new ArgumentNullException("parentElement");

            this.elementNode = elementNode;
            this.ParentElement = parentElement;
            this.ProjectOwner = parentElement.ProjectOwner;

            this.MetricDictionary = new Dictionary<LanguageAnalyzer.Metrics, double>();
        }

        #endregion

        #region Properties

        public abstract string Identifier { get; }
        public abstract ElementKinds Kind { get; }
        public IElementBase ParentElement { get; private set; }
        public IProjectElement ProjectOwner { get; private set; }

        public abstract ITypeBase Type { get; }

        public abstract bool IsAbstract { get; }
        public abstract bool IsStatic { get; }
        public abstract VisibilityStates Visibility { get; }

        public Dictionary<LanguageAnalyzer.Metrics, double> MetricDictionary { get; private set; }

        #endregion
    }
}
